package org.tourism.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.tourism.entity.DiningEntertainment;
import org.tourism.mapper.DiningEntertainmentMapper;
import org.tourism.service.DiningEntertainmentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wuling
 * @since 2024-07-05
 */
@Service
public class DiningEntertainmentServiceImpl extends ServiceImpl<DiningEntertainmentMapper, DiningEntertainment> implements DiningEntertainmentService {
    @Autowired
    private DiningEntertainmentMapper  diningEntertainmentMapper;
    @Override
    public int insertEntertainment(DiningEntertainment entertainment) {
        return diningEntertainmentMapper.insert(entertainment);
    }

    @Override
    public int updateEntertainment(DiningEntertainment entertainment) {
        return diningEntertainmentMapper.updateById(entertainment);
    }

    @Override
    public int deleteEntertainment(DiningEntertainment entertainment) {
        return diningEntertainmentMapper.deleteById(entertainment.getId());
    }

    @Override
    public DiningEntertainment getEntertainment(int id) {
        return diningEntertainmentMapper.selectById(id);
    }

    @Override
    public List<DiningEntertainment> getAllEntertainment() {
        return diningEntertainmentMapper.selectList(null);
    }
}
